<h2>Objectives</h2>
	Showing all Goals <span class="pull-right">
    <i class="icon-screenshot"></i> <a href="<?= site_url('founder/goals/create_objective')?>">Create company objective</a>
    &nbsp;&nbsp;
    <i class="icon-plus"></i> <a href="<?= site_url('founder/goals/create_goal')?>">Create a Goal</a>
    </span>
<hr />
<br />

<?php 


?>
<div id="contentLeft">
<ul class="ui-sortable" style="list-style:none;margin:0;">

<?php foreach($objectives as $objective) {
	$startDate = strtotime(date('Y-m-d')); 
	$endDate = strtotime($objective->due_date); 
	$due_date = date('d', $endDate) - date('d', $startDate); 
	?>
    <li>

<div class="row-fluid">

<div class="span5">
<span class="handler" style="cursor:move;"><i class="icon-move"></i></span>
<a href="#" rel="tooltip" title="asd" class="tooltips"><strong><?= $objective->title;?></strong></a></div>
<div class="span3 "><strong>Due in </strong><?= $due_date;?> days</div>
<div class="span1">Progress:</div>
<div class="span2">
<div class="progress progress-success  progress-striped">
<div class="bar" style="width: 60%"></div>
</div>
</div>
</div>
</li>
<?php }?>
</ul>
</div>
<!-- Drag n drop code ends here -->

<script type="text/javascript">

$(document).ready(function(e) {
	// drag n drop
	
	jQuery(function() {
		//alert("asdds");	
		jQuery("#contentLeft ul").sortable({  handle: '.handler', opacity: 0.6, cursor: 'move',  update: function() {			
			var order = jQuery(this).sortable("serialize") + '&action=updateRecordsListings'; 
		//	alert(order);
			jQuery.post("<?= site_url('');?>", order, function(theResponse){
				//alert(theResponse);
			}); 															 
		}								  
		});
		});
		
		});
		
		</script>